// 生成随机日期
const randomDate = (start, end) => {
  const date = new Date(
    start.getTime() + Math.random() * (end.getTime() - start.getTime())
  );
  return date.toISOString().slice(0, 19).replace("T", " ");
};

// 生成标准管理数据
export const generateStandardData = (count = 100) => {
  const standardTypes = [
    "医用口罩",
    "防护服",
    "医用手套",
    "医用帽",
    "医用鞋套",
  ];

  return Array.from({ length: count }, (_, index) => ({
    id: index + 1,
    标准名称: `${
      standardTypes[Math.floor(Math.random() * standardTypes.length)]
    }通用技术要求`,
    标准编号: `GB/T ${Math.floor(Math.random() * 90000) + 10000}-${
      2020 + Math.floor(Math.random() * 4)
    }`,
  }));
};

// 生成项目管理数据
export const generateProjectData = (count = 100, standardId = null) => {
  const projectTypes = [
    "基本要求",
    "口罩带连接强度",
    "微生物指标",
    "过滤效率",
    "气密性",
    "阻燃性能",
    "压力差",
  ];

  return Array.from({ length: count }, (_, index) => ({
    id: index + 1,
    序号: (index + 1).toString(),
    项目名称: projectTypes[Math.floor(Math.random() * projectTypes.length)],
    "  准编号（含年号）": `GB/T ${Math.floor(Math.random() * 90000) + 10000}-${
      2020 + Math.floor(Math.random() * 4)
    }`,
    standardId: standardId || Math.floor(Math.random() * 100) + 1,
  }));
};
